package suery;

/**
 * Exception of Suery shows whether there is an error in expression or the
 * component the user has queried cannot be found.
 * 
 * @author Jeky
 * 
 */
public class SueryException extends RuntimeException {

    public SueryException(String message, Throwable cause) {
        super(message, cause);
    }

    public SueryException(String message) {
        super(message);
    }

    /**
     * Exception when querying.
     * 
     * @author Jeky
     * 
     */
    public static class Query extends SueryException {

        public Query(String token) {
            super("Cannot find the component. Token : " + token);
        }

    }

    /**
     * Exception when parsing.
     * 
     * @author Jeky
     * 
     */
    public static class Parse extends SueryException {

        public Parse(String token) {
            super("Cannot parse token : " + token);
        }

        public Parse(String token, Exception e) {
            super("Cannot parse token : " + token, e);
        }
    }
}
